<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/16 16:55
 * Modified Time: 2019/7/16 16:55
 * Version: 2.0
 */

namespace App\Modules\System\Controllers;


use App\Lib\Utilities;
use App\Modules\System\Services\VideoService;
use Flower\Core\Http\BaseController;
use Illuminate\Http\Request;

class VideoController extends BaseController
{
    private $videoService;

    public function __construct(VideoService $videoService)
    {
        $this->videoService = $videoService;
    }
    public function uploadVideo(Request $request){
        $data = $this->videoService->upload($request->all());

        return $this->display($data,'上传成功');
    }
    /**
     * 上传OSS的视频，是一个访问路径
     * @param Request $request
     * @return mixed
     */
    public function uploadOSSVideo(Request $request){
        $data = $this->videoService->addByOSSUrl($request->video_url);
        return $this->display($data,'上传成功');
    }
}